These files include all data and code necessary to replicate the results in "Keep the Kids Inside? Juvenile Curfews and Urban Gun Violence." There are two .do files that can generate all of the results. They are 
described in the order in which they should be run. We have also included a LaTeX file to convert the results into a .pdf. Pre-processing data files are also included, and we include descriptions of the data and their sources below. 
Analysis was performed using ArcMap, STATA (current files for version 15) and TexMaker (as a LaTeX "wrapper"). 

********************************
Code:
1. make_panel.do: This STATA .do file takes the original data and converts it into an hourly panel of gunshots.
2. replicate_results.do: This STATA .do file uses the hourly gunshot panel created in "make_panel.do" to replicate all of the tables and figures in the paper.
3. figuresandtables.tex: This LaTeX file takes the figures and tables created by the "replicate_results.do" file and places them neatly into a pdf. 

Preprocessed panels for reference:
1. hourlypanel.dta: Main panel used to generate tables and figures. Generated (and replaced) by "make_panel.do"
3. calls_panel.dta: Intermediary file generated (and replaced) by "make_panel.do"
4. sst_activations_panel.dta: Intermediary file generated (and replaced) by "make_panel.do"
5. sst_inc_psa.dta: Intermediary file generated (and replaced) by "make_panel.do"
6. mpd_reports_panel.dta: Intermediary file generated (and replaced) by "make_panel.do"


Original data:
1. psa_ss_inc_join.txt: This .txt file was generated by bringing the original ShotSpotter data into ArcMap, mapping it, matching the gunshots to the Police Service Area (PSA) in which it occurred, and outputting the result. (source: Washington D.C. Metropolitan Police, author's mapping)
2. sst_incidents.dta: This STATA .dta file contains the original ShotSpotter data obtained from the Washington D.C. Metropolitan Police. (source: Washington D.C. Metropolitan Police)
3. dccrime_2011.dta: This STATA .dta file contains incident-level crime reports from 2011 obtained from the Washington D.C. Metropolitan Police. This dataset contains the Police Service Area (PSA), so it did not need to be processed using ArcMap. (source: Washington D.C. Metropolitan Police)
4. dccrime_2012.dta: This STATA .dta file contains incident-level crime reports from 2012 obtained from the Washington D.C. Metropolitan Police. This dataset contains the Police Service Area (PSA), so it did not need to be processed using ArcMap. (source: Washington D.C. Metropolitan Police)
5. dccrime_2013.dta: This STATA .dta file contains incident-level crime reports from 2013 obtained from the Washington D.C. Metropolitan Police. This dataset contains the Police Service Area (PSA), so it did not need to be processed using ArcMap. (source: Washington D.C. Metropolitan Police)
6. calls911_psatract.dta: This STATA .dta file was generated by bringing the original 911 call data into ArcMap, mapping it, matching the calls to the Police Service Area (PSA) in which it occurred, outputting the result, and then saving it as a STATA file. (source: Washington D.C. Metropolitan Police)
7. empty_panel.dta: This STATA dataset is "empty" in that it contains an observation for each PSA on each day in the study period. Other datasets are merged onto it. (source: author's construction)
8. rain_hourly.dta: This STATA dataset contains hourly rain totals as reported at Washington Reagan Airport. (source: National Oceanic and Atmospheric Administration)
9. weather.data: This STATA dataset contains daily high and low temperatures and liquid precipitation totals as reported at Washington Reagan Airport. (source: National Oceanic and Atmospheric Administration)

**********************************
Data Dictionary for hourlypanel.dta:
psa - Police Service Area
date_m - machine-readable date
hour - hour of day (0 = midnight, 23 = 11 pm)
district - Police district
psa_num_hom - number of reported homicides in PSA X in hour Y
psa_num_rep - number of reported crimes in PSA X in hour Y
psa_num_gun - number of reported gun crimes in PSA X in hour Y
psa_num_vio - number of reported violent crimes in PSA X in hour Y
psa_num_inc - number of ShotSpotter activations in PSA X in hour Y
num_calls - number of 911 calls in PSA X in hour Y
num_calls_mpd - number of 911 calls for police assistance in PSA X in hour Y
num_calls_gunshot - number of 911 calls to report gunshots in PSA X in hour Y
prcp - hourly precipitation in millimeters
year - calendar year
doy - day of calendar year
dow - day of week (0 = Sunday)
month - month of calendar year
day - day of month
eleven - binary indicator that the hourly observation is for the 11pm hour
start - binary indicator that the observation date is in the sample period for the July cutoff
end - binary indicator that the observation date is in the sample period for the September cutoff
run_var_start - normalized running variable to the July 1 cutoff
run_var_end - normalized running variable to the September 1 cutoff
curfew_early - binary indicator for whether the 11 pm curfew is in effect
runvar_start_int - an interaction between "run_var_start" and "curfew_early"
runvar_end_int - an interaction between "run_var_end" and "curfew_early"
school - binary indicator that DC city schools are in session
psa_id - numeric id assigned to PSA for easier machine readability
coverage - binary indicator for whether Police District had ShotSpotter in use a given time
prcpday - daily precipitation total
tmax - daily maximum temperature (in Celsius)
tmin - daily minimum temperature (in Celsius)
